package com.wan.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * 图片网路映射
 * @author admin
 */
@Component
public class WebConfigurer extends WebMvcConfigurerAdapter {
    @Autowired
    StaticImageConfig staticImageConfig;
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/images/**").addResourceLocations("file:///"+staticImageConfig.getUploadPath());
    }

}